<?php

namespace Apps\Common\Models;

/**
 * 开通城市Model
 * @author     chenxiaolin
 * @date        2016年1月19日
 * @version     2.0.0
 * @copyright   Copyright 2016 meelier.com
 */
class SysOpenCity extends \PhalconPlus\Database\Model
{

    /**
     *
     * @var integer
     */
    public $city_id;

    /**
     *
     * @var string
     */
    public $city_code;

    /**
     *
     * @var string
     */
    public $city_name;

    /**
     *
     * @var integer
     */
    public $city_order;

    /**
     *
     * @var integer
     */
    public $city_state;

    /**
     *
     * @var string
     */
    public $city_addtime;

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'sys_open_city';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return SysOpenCity[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return SysOpenCity
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

    /**
     * Independent Column Mapping.
     * Keys are the real names in the table and the values their names in the application
     *
     * @return array
     */
    public function columnMap()
    {
        return array(
            'city_id' => 'city_id',
            'city_code' => 'city_code',
            'city_name' => 'city_name',
            'city_order' => 'city_order',
            'city_state' => 'city_state',
            'city_addtime' => 'city_addtime'
        );
    }

    public function defaultColumns()
    {
        return [
            'city_order',
            'city_state',
            'city_addtime',
        ];
    }

}
